


Route::group(function(){
    Route::get('goods_category', 'goods/category'); //商品分类
    Route::get('goods_list', 'goods/goods_list'); //商品列表
    Route::post('notify', 'order/notify'); //支付回调
    Route::get('goods_comments', 'goods/goods_comments'); //商品评价
    Route::get('check_order_expire', 'task/check_order_expire'); //定时任务 订单自动过期
    Route::get('auto_take', 'task/auto_take'); //定时任务 订单自动过期
});

Route::group(function(){
    Route::get('goods_detail', 'goods/detail'); //商品详情
    Route::post('goods_collection', 'goods/goods_collection'); //商品收藏/取消收藏
    Route::get('my_collection', 'goods/my_collection'); //我的收藏
    Route::post('add_cart', 'goods_cart/add'); //添加购物车
    Route::post('confirm_order', 'order/confirm'); //确认订单
    Route::post('confirm_orders', 'order/confirms'); //购物车确认订单
    Route::post('create_order', 'order/create'); //提交订单
    Route::get('order_list', 'order/order_list'); //订单列表
    Route::post('cancer_order', 'order/cancel'); //订单取消
    Route::post('delete_order', 'order/del'); //订单删除
    Route::post('order_comment', 'order/comment'); //订单评价
    Route::post('order_pay', 'order/pay'); //已存在订单支付
    Route::post('order_sure', 'order/take'); //订单收货
    Route::post('order_refund', 'order/refund'); //申请退款
    Route::get('order_detail', 'order/detail'); //订单详情
    Route::get('user_coupon', 'coupon/user_coupon'); //我的优惠券
    Route::get('coupon_list', 'coupon/list'); //我的优惠券
    Route::post('receive_coupon', 'coupon/receive'); //领取优惠券
    Route::get('user_cart', 'goods_cart/list'); //我的购物车
    Route::post('cart_num', 'goods_cart/num'); //更改购物车数量
    Route::post('del_cart', 'goods_cart/del'); //删除购物车
    Route::post('order_computed', 'order/computedOrder'); //计算订单金额
    Route::get('address_list', 'user_address/address_list'); //收货地址列表
    Route::post('add_address', 'user_address/add'); //添加收货地址
    Route::post('edit_address', 'user_address/add'); //编辑收货地址
    Route::post('del_address', 'user_address/address_del'); //删除收货地址
    Route::post('set_default_address', 'user_address/address_default_set'); //设置默认收货地址
    Route::post('get_address_default', 'user_address/get_address_default');


    Route::get('user_distributor_detail', 'distributor/user_distributor_detail'); //分销商详情
    Route::post('commission_apply', 'distributor/commission_apply'); //申请分销
    Route::get('user_commission', 'distributor/user_commission'); //我的佣金
    Route::post('withdrawal', 'distributor/withdrawal'); //我的佣金提现

})->allowCrossDomain()
->middleware(\app\api\middleware\TokenMiddleware::class,true);// jwt认证